<?php
class cls_control_base
{
	var $name;
	static function get_instance($class)
	{
		$cls = "cls_control_{$class}";
		$instance = new $cls();
		$instance->name = $class;
		return $instance;
	}
	
	static function action($action = "")
	{
		$str = explode('.', $action, 2);
		$class = !empty($str[0]) ? $str[0] : 'index';
		$act = isset($str[1]) ? $str[1] : 'show';
		$instance = self::get_instance($class);
		$instance->$act();
	}
	
	static function check_if_empty($string)
	{
		if(isset($string) && !empty($string))
		{
			return false;
		}
		else
		{
			return true;
		}
	}
}